<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>创建射击成绩记录</title> 
<%@ include file="/common/include.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script>
$(document).ready(function() {
	var status = "${status}";
	if(status.length>0){
		if(status=="1")
		{
			alert("创建成功!");
		}else{
			alert("创建失败!");
		}
		window.location.href="${pageContext.request.contextPath}/page/shootScoreList.jsp";
	}
});

function materialcreatesubmit() {
	var isValidatestate = true;
	var type_mask = '0';
	var cd_mask = '';
	var page = '1';
	var rows = '15';
	var r = /^[1-9]*[0-9][0-9]*$/; //正整数
	var t = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)([\w-]+\.)+(\S)+$/i;
	var te = /^([\w-]+\.)+(\S)+$/i;
	var a = /select|insert|update|dalete|\'|\/\*|\.\.\/|union|into|load_file|outfile/;
	var name = $.trim($("#s_id").val()); //获取广告位名称
	var txt_len = $.trim(name).length;
	
	name = $("#totalTime").val();
	if(name ==''){
		$("#tp_totalTime").show();
		$("#tp_totalTime").html('总时间不能为空');
		return false;
	}
	$("#tp_totalTime").hide();
	
	name = $("#stopTime1").val();
	if(name ==''){
		$("#tp_stopTime1").show();
		$("#tp_stopTime1").html('短停时间1不能为空');
		return false;
	}
	$("#tp_stopTime1").hide();
	
	name = $("#stopTime2").val();
	if(name ==''){
		$("#tp_stopTime2").show();
		$("#tp_stopTime2").html('短停时间2不能为空');
		return false;
	}
	$("#tp_stopTime2").hide();
	
	name = $("#stopTime3").val();
	if(name ==''){
		$("#tp_stopTime3").show();
		$("#tp_stopTime3").html('短停时间3不能为空');
		return false;
	}
	$("#tp_stopTime3").hide();
	
	name = $("#leapDistance1").val();
	if(name ==''){
		$("#tp_leapDistance1").show();
		$("#tp_leapDistance1").html('跃进距离1不能为空');
		return false;
	}
	$("#tp_leapDistance1").hide();
	
	name = $("#leapDistance2").val();
	if(name ==''){
		$("#tp_leapDistance2").show();
		$("#tp_leapDistance2").html('跃进距离2不能为空');
		return false;
	}
	$("#tp_leapDistance2").hide();
	
	name = $("#leapDistance3").val();
	if(name ==''){
		$("#tp_leapDistance3").show();
		$("#tp_leapDistance3").html('跃进距离3不能为空');
		return false;
	}
	$("#tp_leapDistance3").hide();
	
	name = $("#fixHit").val();
	if(name ==''){
		$("#tp_fixHit").show();
		$("#tp_fixHit").html('固定命中不能为空');
		return false;
	}
	$("#tp_fixHit").hide();
	
	name = $("#moveHit").val();
	if(name ==''){
		$("#tp_moveHit").show();
		$("#tp_moveHit").html('运动命中不能为空');
		return false;
	}
	$("#tp_moveHit").hide();
	
	name = $("#gunHit").val();
	if(name ==''){
		$("#tp_gunHit").show();
		$("#tp_gunHit").html('机枪命中不能为空');
		return false;
	}
	$("#tp_gunHit").hide();
	
	name = $("#score").val();
	if(name ==''){
		$("#tp_score").show();
		$("#tp_score").html('成绩不能为空');
		return false;
	}
	$("#tp_score").hide();

	document.getElementById("form").submit();
}

function comeback() {
	window.location="${pageContext.request.contextPath}/page/shootScoreList.jsp";
}
</script>
</head>

<body>
<div class="wrapper">
	<jsp:include page="/common/header.jsp"><jsp:param value="3" name="nav"/></jsp:include>
	<div class="content" style="">
		<div class="col_l">
			<div class="l_top"></div>
			<div class="l_menu">
			      <jsp:include page="/common/l_score_place.jsp"><jsp:param value="2" name="nav"/></jsp:include>
			</div>
			<div class="l_bottom"></div>
		</div>
		<div class="col_r" style="">
			<div class="guide blue">
				<span class="left">当前位置：<a href="${pageContext.request.contextPath }/page/shootScoreList.jsp">射击成绩管理</a> > 创建成绩记录</span>
			</div>
			<div class="mx_title">
				<div class="cj_l"></div>
				<div class="cj_c"> 创建成绩记录</div>
				<div class="cj_r"></div>
			</div>                
			<form id="form" name="form" action="${pageContext.request.contextPath }/shootScore/update" method="post">				 
				<div class="cj_con" id="main" style="">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr style="" id='trmaterialname'>
							<td width="14%" height="35" align="right">学员：</td>
                            <td width="2%" align="center"><div class="star">*</div></td>
                            <td width="84%">
                            	<input type="hidden" id="id" name="id" value="${shootScore.id }"/>
                            	<input type="hidden" id="studentId" name="studentId" value="${shootScore.student.id }"/>
                            	<input type="text" id='studentName' name="studentName" size="25"  value='${shootScore.student.name }' disabled="disabled" class="input_cj left" />                 
                            	<div class="tips_error left" style="display:none;"  id='nomaterialname'></div>
                             </td>
						</tr>
						<tr style="">
                            <td height="35" align="right">日期：</td>
                            <td width="2%" align="center"><div class="star">*</div></td>
                            <td>
								<input  type="text" id="trainDate" name="trainDate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate" value="<fmt:formatDate value="${shootScore.trainDate}" pattern="yyyy-MM-dd"/>"/>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">总时间：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="totalTime" name="totalTime" value="${shootScore.totalTime }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_totalTime"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">短停时间1：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="stopTime1" name="stopTime1" value="${shootScore.stopTime1 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_stopTime1"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">短停时间2：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="stopTime2" name="stopTime2" value="${shootScore.stopTime2 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_stopTime2"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">短停时间3：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="stopTime3" name="stopTime3" value="${shootScore.stopTime3 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_stopTime3"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">跃进距离1：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="leapDistance1" name="leapDistance1"  value="${shootScore.leapDistance1 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_leapDistance1"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">跃进距离2：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="leapDistance2" name="leapDistance2" value="${shootScore.leapDistance2 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_leapDistance2"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">跃进距离3：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="leapDistance3" name="leapDistance3"  value="${shootScore.leapDistance3 }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_leapDistance3"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">固定命中：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="fixHit" name="fixHit"  value="${shootScore.fixHit }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_fixHit"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">运动命中：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="moveHit" name="moveHit" value="${shootScore.moveHit }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_moveHit"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">机枪命中：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="text"  size="5" class="input_cj" id="gunHit" name="gunHit" value="${shootScore.gunHit }"/></span>
								<div style="display:none;" class="tips_error left" id="tp_gunHit"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">成绩：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left">
									<select name="score" class="select_1" style="width: 70px" id="score">
										<option value="1" <c:if test="${shootScore.score == 1 }">selected = "selected"</c:if>>优秀</option>;
										<option value="2" <c:if test="${shootScore.score == 2 }">selected = "selected"</c:if>>良好</option>;
										<option value="3" <c:if test="${shootScore.score == 3 }">selected = "selected"</c:if>>及格</option>;
										<option value="4" <c:if test="${shootScore.score == 4 }">selected = "selected"</c:if>>不及格</option>;
									</select>
								</span>
								<div style="display:none;" class="tips_error left" id="tp_score"></div>
							</td>
						</tr>
					</table>
					<div style=" margin-left:120px; margin-top:10px;">
						<a href="javascript:void(0)" id='onsubmit'>
							<img onclick="materialcreatesubmit();" src="${pageContext.request.contextPath}/images/over.gif" />
					  	</a>
					    <img onclick='comeback();'src='${pageContext.request.contextPath}/images/formcacle.gif' style="margin-left:15px;cursor:pointer"/>
					</div>
				</div>
			</form> 
		</div>
		 
		   <div class="clear"></div>
		   
	  </div>

<div class=footer>CopyRight &copy;Research Institute of Computer Systems of SCUT. All Rights Reserved
	</div>
</div>
<script>
function showHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="";

} 

function closeHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="none";
}
	</script>
</body>
</html>